#include<bits/stdc++.h>
using namespace std;
const int MOD = 99991;
int qpow(int x,int p){
    int res = 1;
    while(p){
        if(p & 1){
            res = 1ll*x*res%MOD;
        }
        x = 1ll*x*x%MOD;
        p >>= 1;
    }
    return res;
}
typedef pair<long double,long double> com;
com operator*(com va,com vb){
    return {va.first*vb.first - va.second*vb.second,va.first*vb.second + va.second*vb.first};
}
com operator+(com va,com vb){
    return {va.first + vb.first,va.second + vb.second};
}
com operator-(com va,com vb){
    return {va.first - vb.first,va.second - vb.second};
}
vector<int> trs[19];
void init(){
    for(int lgt = 0;lgt < 19;lgt++){
        int tot = 1<<lgt;
        trs[lgt] = vector<int>(tot);
        for(int i = 1;i < tot;i++){
            trs[lgt][i] = (trs[lgt][i >> 1]>>1) | ((i & 1)<<(lgt - 1));
        }
    }
}
const long double PI = acosl(-1);
vector<com> FFT(const vector<com> &val,int tot,int lgt){
    vector<com> res(tot);
    for(int i = 0;i < tot;i++){
        if(trs[lgt][i] < val.size()){
            res[i] = val[trs[lgt][i]];
        }
    }
    for(int i = 1;i <= lgt;i++){
        int len = 1<<i;
        int hlen = len/2;
        com one = {cosl(PI/hlen),sinl(PI/hlen)};
        for(int j = 0;j < tot;j+=len){
            com base = {1,0};
            for(int k = 0;k < hlen;k++,base  = base*one){
                com v1 = res[j + k],v2 = base*res[j + k + hlen];
                res[j + k] = v1 + v2;
                res[j + k + hlen] = v1 - v2;
            }
        }
    }
    return res;
}
vector<com> IFFT(const vector<com> &val,int tot,int lgt){
    vector<com> res(tot);
    for(int i = 0;i < tot;i++){
        if(trs[lgt][i] < val.size()){
            res[i] = val[trs[lgt][i]];
        }
    }
    for(int i = 1;i <= lgt;i++){
        int len = 1<<i;
        int hlen = len/2;
        com one = {cosl(PI/hlen),-sinl(PI/hlen)};
        for(int j = 0;j < tot;j+=len){
            com base = {1,0};
            for(int k = 0;k < hlen;k++,base  = base*one){
                com v1 = res[j + k],v2 = base*res[j + k + hlen];
                res[j + k] = v1 + v2;
                res[j + k + hlen] = v1 - v2;
            }
        }
    }
    return res;
}
vector<int> operator*(vector<int> va,vector<int> vb){
    vector<com> vl(max(va.size(),vb.size()));
    for(int i = 0;i < va.size();i++){
        vl[i].first = va[i];
    }
    for(int i = 0;i < vb.size();i++){
        vl[i].second = vb[i];
    }
    int lgt = 32 - __builtin_clz(vl.size()*2);
    int tot = 1<<lgt;
    vl = FFT(vl,tot,lgt);
    for(int i = 0;i < tot;i++){
        vl[i] = vl[i]*vl[i];
    }
    vl = IFFT(vl,tot,lgt);
    vector<int> res(va.size() + vb.size() - 1);
    tot<<=1;
    for(int i = 0;i < va.size() + vb.size() - 1;i++){
        res[i] = (((long long)round(vl[i].second/tot))%MOD + MOD)%MOD;
    }
    return res;
}
const int N = 1e5+10;
int a[N];
int jc[N],jc_1[N];
int C(int n,int m){
    if(m > n){
        return 0;
    }
    if(m <= n){
        return 1ll*jc[n]*jc_1[n - m]%MOD*jc_1[m]%MOD;
    }
    return 1ll*C(n/MOD,m/MOD)*C(n%MOD,m%MOD)%MOD;
}
pair<vector<int>,vector<int>> F(int l,int r){
    if(l == r){
        vector<int> res = {1,qpow(3,a[l])};
        vector<int> res1(2,1);
        if(a[l] % 2 != 0){
            res1[1] = MOD - 1;
        }
        return make_pair(res,res1);
    }
    int mid = (l + r)/2;
    pair<vector<int>,vector<int>> res1 = F(l,mid);
    pair<vector<int>,vector<int>> res2 = F(mid+1,r);
    return make_pair(res1.first*res2.first,res1.second*res2.second);    
}
int main(){
    init();
    int n,k;
    cin>>n>>k;
    for(int i = 1;i<=n;i++){
        cin>>a[i];
        a[i] %= MOD - 1;
    }
    jc[0] = jc_1[0] = 1;
    for(int i = 1;i < n;i++){
        jc[i] = jc[i - 1]*i%MOD;
    }
    jc_1[n] = qpow(jc[n],MOD - 2);
    for(int i = n - 1;i > 0;i--){
        jc_1[i] = 1ll*jc_1[i + 1]*(i + 1)%MOD;
    }
    pair<vector<int>,vector<int>> res = F(1,n);
    int f0,f1;
    cin>>f0>>f1;
    /*
    a + b = f0
    3a - b = f1
    4a = f0+f1
    b  = f0 - a
    */
    int a = 1ll*(f0 + f1)%MOD*qpow(4,MOD - 2)%MOD;
    int b = (f0 - a + MOD)%MOD;
    cout<<(1ll*a*res.first[k]%MOD + 1ll*b*res.second[k]%MOD)%MOD;
}